<template>
  <div>
            <div class="honours">
              
            <div class="honourList" @click="btnClick(item)" v-for="(item,index) in honourList" :key="index">
           <!-- <div class="title" >{{ item.url}}</div> -->
             <div> 
           <img style="width: 100%;text-align: center;" :src="item.url">
  <!-- <img style="width: 100%;text-align: center;" :src="changeUrl(item.img[0].fileName)"> -->

           </div> 
            <div class="title" >{{ item.honourTitle}}</div>
             
            <div class="time" >{{ item.createTime}}</div>
            <!-- <div class="time" >{{ item.newsId}}</div> -->
            <!-- <van-divider customStyle="color: #070707;width: 95%;"/> -->
            <van-divider />
                <!-- <span class="date" v-html="item.newsContent">{{ item.newsContent}}</span> -->
            </div>

  </div>

  </div>
</template>
<script>
import { listHonour, listHonourClick, updateHonourClick } from '@/api/honour'
  export default {
    data(){
          return {
           honourList: [], 
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 20,
        honourTitle: undefined,
        createBy: undefined,
        status: '0'
          },
          honourListClick: [],
          }
    },
     computed: {},
   mounted() {
    this.getHonourList();
  },
    created() {},
  methods: {
    //查询列表
        getHonourList() {
      listHonour(this.queryParams).then(response => {
        this.honourList = response.rows
        // .filter(item => {
        //   if (item.img && item.img !== '[]') {
        //     console.log("1111")
        //     return item
        //   }
        // })
        this.honourList.map(item => {
          //item.img = JSON.parse(item.img)
          item.url=this.getObjectKeys(item.honourContent)
        })
      //  this.total = response.total
      })
      // listHonourClick(this.queryParams).then(response => {
      //   this.honourListClick = response.rows
      // })
    },

    //点击选中
    btnClick(data) {
      //data.img = JSON.stringify(data.img)
      updateHonourClick(data)
       console.log(data)
      this.$router.push({
        path: './honourdetail/main',
        query: {
          id: data.honourId
        }
      })
    }
  }
}


</script>
<style scoped>
.news{
  background-color: rgb(255, 255, 255);
  width: 95%;
  margin: 20rpx 20rpx 15rpx;
  -moz-box-shadow:2rpx 2rpx 5rpx #969696;
  -webkit-box-shadow:2rpx 2rpx 5rpx #838080;
  box-shadow:2rpx 2rpx 5rpx #969696;
  display:flex;
	padding:0 0px;
	flex-wrap:wrap;
  border-radius: 5px;
}
.newsList{
  width: 95%;
   font-size: 12pt;
    padding: 20rpx;
}
.title{
  color: #070707;
}
.time{
   text-align: right;
   color: #35353598;
   font-size: 10pt;
}
</style>